Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

부산대 Android 김민혁 4주차 과제 STEP1 #54

Open
wants to merge 55 commits into
base: kyleidea1
Choose a base branch
from

Conversation

kyleidea1
Copy link

@kyleidea1 kyleidea1 commented Jul 18, 2024

STEP 1 완료했습니다!

  1. 처음 위치를 초기화하는 부분에서 나름 고민을 많이 했는데, 더 개선할 부분이 있는 지 궁금합니다.
  • 처음에는 기본 위치를 부산대학교의 위도,경도로 초기화
  • 이전 sharedpreference의 lastLatLng가 비어있지 않으면(이전에 포커스했던 장소가 있으면) 해당 위치로 초기화
  1. bottom sheet을 구현하는 과정에서 조금 헤맸는데, 개선할 부분을 알려주시면 감사하겠습니다.

추가로 제가 지금까지 실수로 다른 main 브랜치에 pr을 넣어서 리뷰요청이 안 갔었습니다. 죄송합니다..!

MyStoryG and others added 30 commits June 25, 2024 01:19
- Added a new view 'activity_search.xml' which includes a simple search bar layout using SearchView.
- Added SearchMainActivity which is activity for activity_search.xml
These data would be results of searching.
Added information related to local database.
- Renamed DBHelper to PlaceDBHelper
- Added PlaceDBHelper class with methods to create the PlaceTable and insert initial place data
- Implemented the SearchHistoryDBHelper class to manage search history in a new SearchHistoryTable
- Added methods to insert, delete, and retrieve search history entries

Closes #789
- Moved the Place data class from PlaceDBHelper to its own file for better code organization.
…history

- Implemented SearchHistoryRecyclerViewAdapter to manage and display search history items in a RecyclerView.
- Added ViewHolder class for binding search history items and handling item clicks and deletions.
- Updated onBindViewHolder to handle click events for item selection and deletion, including updating the RecyclerView.
…esults

- Updated the filtering logic in SearchActivity to correctly filter search results based on the entered query.
- reset previous commits by hard option to find error. recommit normally operating files(activity_search.xml, AndroidManifest.xml, DBHelper.kt, SearchMainActivity.kt)
- Extracted PlaceDBHelper for managing the PlaceTable database operations.
- Extracted SearchHistoryDBHelper for managing the SearchHistoryTable database operations.
- Deleted DBHelper.kt which previously contained combined functionality.
- Updated visibility attribute of RecyclerView with ID 'recycler_view' to 'visible' to ensure search results are displayed correctly.
- Adjusted visibility attribute of TextView with ID 'no_results' to 'gone' to hide the message when search results are present.
- To fix visibility bug of no_result.
- Added Place, PlaceMeta, RegionInfo, and ResultSearchKeyword data classes
- Represents the structure of data received from Kakao Local API
- Created KakaoLocalApi interface defining API endpoints
- Implemented searchKeyword function to fetch search results from Kakao API
…o API

- Implemented KakaoRepository class to handle API requests and responses
- Includes searchKeyword function to fetch search results asynchronously
- Created a new application class `KyleMaps` to initialize the Retrofit instance.
- Added KyleMaps into AndroidManifest.xml
kyleidea1 added 25 commits July 10, 2024 21:23
- Added icon image assets and added into AndroidManifest.xml
Removed activity_main_search to improve code maintainability and reduce unused resources.
Removed PlaceDBHelper.kt as PlaceDB became useless
Replaced Place.kt and added PlaceMeta.kt, RegionInfo.kt, SearchActivity.kt
Added KakaoRepository.kt to get sources using Kakao API
Added KyleMaps.kt which is instance of Application class of entire application.
Added arrow_back.xml and ic_search.xml to use at map activity layout
Added MapActivity.kt and activity_map.xml
Modified AndroidManifest.xml
- Updated readme for STEP1 of android-map-location
- MapActivity displays clicked item's location
- Does not appear until selecting an item in the result recycler view
- image source: location_marker.png, with a text refers name of the place
…n app restarted

- Focus same place as the last place before termination of application
- remember position using sharedPreference
- AuthenticationErrorActivity.kt
- activity_authentication_error.xml
- and images in these files
- bottom_sheet_background.xml, layout_map_bottom_sheet_dialog.xml
- Added variables related to bottom sheet
- Added finish() part in eventListner of searchButton in MapActivity
- Now MapActivities doesn't stack
# Conflicts:
#	app/src/main/java/campus/tech/kakao/map/SearchActivity.kt
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_map)

mapView = findViewById(R.id.map_view)
searchButton = findViewById(R.id.search_button)
val bottomSheetLayout = layoutInflater.inflate(R.layout.layout_map_bottom_sheet_dialog, null)
bottomSheet = BottomSheetDialog(this)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

미리 셋팅해야할게 있는게 아니라면
bottomSheet가 필요할때 객체를 생성하는건 어떨까요?


val defLat = "35.231627"
val defLng = "129.084020"
val lastLatLng = getSharedPreferences("lastLatLng", MODE_PRIVATE)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sharedPreference에선 double형을 읽고 쓸수가 없어서 string type으로 관리하셨군요
잘 하셨는데 읽고 쓰는부분을 캡슐화하면 어떨까요?
함수도 좋고 클래스도 좋습니다. 내부에서 string으로 관리하는지는 상관하지 않고
사용하는곳에서는 double로 간단히 쓸수 있게끔요

// Intent에서 값을 가져옴
intent?.let {
latitude = it.getStringExtra("mapY") ?: latitude
longitude = it.getStringExtra("mapX") ?: longitude
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intent extra에 들어가는 key값들은 보내는쪽과 받는쪽 둘다 사용하기에 상수로 관리하시면 좋습니다
나중에 바뀔일이 생기면 추적하기 힘들어져서요

@JSpiner
Copy link

JSpiner commented Jul 19, 2024

이미 Step2를 만들어주셔서 이 PR은 머지 안할게요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants